<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			<p:growl />
			<h:outputText value="New SAP ERP Module" styleClass="outputTextTitle" />
			<h:panelGrid columns="3">
				<h:outputLabel value="#{msg['modulename.label']} " />
				<h:outputLabel value=" : " />
				<p:inputText value="#{createSAPERPModuleBean.sapErpModule.SAPERPModule}" />

				<h:outputLabel value="#{msg['displayname.label']}" />
				<h:outputLabel value=" : " />
				<p:inputText value="#{createSAPERPModuleBean.sapErpModule.displayName}" />
				
				<h:outputLabel value="#{msg['dispalyorder.label']}" />
				<h:outputLabel value=" : " />
				<p:inputText value="#{createSAPERPModuleBean.sapErpModule.displayOrder}" />
				
				<h:outputLabel value="#{msg['description.label']} " />
				<h:outputLabel value=" : " />
				<p:inputTextarea value="#{createSAPERPModuleBean.sapErpModule.description}" />
				<h:inputHidden />
				<h:inputHidden />
		</h:panelGrid>
				
		<p:commandButton value="#{createSAPERPModuleBean.assignViewSAPERPModulesButtonLabel}" actionListener="#{createSAPERPModuleBean.toggleAssignPanelDisplay}" update="assignPanel" ajax="false" />	
		
		<p:panel id="assignPanel" style="width: 100%" rendered="#{createSAPERPModuleBean.viewSAPERPModulesList}" >
		
		 <h:panelGrid style="width: 100%; text-align: left; ">
		    <h:outputText value="Available SAP ERP Modules" styleClass="outputTextSubTitle" />
								
		     <p:dataTable id="sapERPModulesTable" style="width: 100%"
									value="#{createSAPERPModuleBean.sapERPModules}"
									selection="#{createSAPERPModuleBean.selectedSAPERPModules}" var="row"
									selectionMode="multiple" rowKey="#{row.SAPERPModuleId}">
									<p:column>
										<f:facet name="header">
											<h:outputText value="Service Name" />
										</f:facet>
										<h:outputText value="#{row.SAPERPModule}" />
									</p:column>
									<p:column>
										<f:facet name="header">
											<h:outputText value="Display Name" />
										</f:facet>
										<h:outputText value="#{row.displayName}" />
									</p:column>
									<p:column>
										<f:facet name="header">
											<h:outputText value="Display Order" />
										</f:facet>
										<h:outputText value="#{row.displayOrder}" />
									</p:column>
									<p:column>
										<f:facet name="header">
											<h:outputText value="Description" />
										</f:facet>
										<h:outputText value="#{row.description}" />
									</p:column>
									

								</p:dataTable>
				</h:panelGrid>
			
		</p:panel>	
				<p:commandButton value="Save Module"
					actionListener="#{createSAPERPModuleBean.saveSapErpModule}" ajax="false" />
			

		</h:form>
	</ui:define>
</ui:composition>